<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="en">
<head>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/statics/css/bootstrap.min.css">
    <title>城市列表</title>
</head>
<body>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-12">
            <input type="button" class="btn btn-success btn-sm" value="添加城市" onclick="location.href='addCity.jsp'"/>
        </div>
    </div>
    <div class="row" style="margin-top: 15px;">
        <div class="col-sm-12">
            <table class="table table-striped table-bordered table-hover">
                <tr>
                    <th>编号</th>
                    <th>名称</th>
                    <th>操作</th>
                </tr>
                <c:forEach var="city" items="${requestScope.cities}" varStatus="c">
                    <tr>
                        <%--使用jstl+EL进行排序--%>
                        <td>${c.count}</td>
                        <td>${city.cname}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/city/dropCity?city.cid=${city.cid}" class="btn btn-danger btn-sm">删除</a>
                        </td>
                    </tr>
                </c:forEach>
            </table>
        </div>

    </div>

</div>


</body>
</html>